home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / NTUMIN10.ARJ / NCUBES.C < prev    next >
Text File  |  1992-03-12  |  1KB  |  52 lines

  1. /******************************************************************************
  2.  *
  3.  *    Program Name : NCUBES.C
  4.  *
  5.  *    Written By : Eng-Huat Ong and Kian-Mong Low.
  6.  *
  7.  *     This function obtains the number of cubes in the solution  array.
  8.  *
  9.  * --------------------------------------------------------------------------
  10.  *    Copyright (c) 1992. All Rights Reserved. Nanyang Technological
  11.  *    University.
  12.  *
  13.  *    You are free to use, copy and distribute this software and its
  14.  *    documentation providing that:
  15.  *
  16.  *        NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.
  17.  *
  18.  *        IT IS NOT MODIFIED IN ANY WAY.
  19.  *
  20.  *        THE COPYRIGHT NOTICE APPEAR IN ALL COPIES.
  21.  *
  22.  *    This program is provided "AS IS" without any warranty, expressed or
  23.  *    implied, including but not limited to fitness for any particular
  24.  *    purpose.
  25.  *
  26.  *    If you find NTUMIN fast, easy, and useful, a note or comment would be
  27.  *    appreciated. Please send to:
  28.  *
  29.  *        Boon-Tiong Tan or Othman Bin Ahmad
  30.  *        School of EEE
  31.  *        Nanyang Technological University
  32.  *        Nanyang Avenue
  33.  *        Singapore 2263
  34.  *        Republic of Singapore
  35.  *
  36.  *****************************************************************************/
  37.  
  38. unsigned short ncubes(a)
  39.  
  40. unsigned char *a;
  41.  
  42. {
  43.    unsigned short c1, c2, c;
  44.  
  45.    c1 = *(a+1);
  46.    c2 = *(a+2);
  47.  
  48.    c  = (c2<<8) | c1;
  49.  
  50.    return (c);
  51. }
  52.